package ca.llsutherland.squash.administrator;

import ca.llsutherland.squash.BaseValidator;
import ca.llsutherland.squash.domain.Administrator;
import ca.llsutherland.squash.role.RolesValidator;

public class AdministratorsValidator extends BaseValidator {

    public static void validate(Administrator expected, Administrator actual) {
        assertValidDomainObject("Administrator should not be null and should have a not null id", actual);
        assertEquals("passwords should be the same", expected.getPassword(), actual.getPassword());
        assertEquals("first names should be the same", expected.getFirstname(), actual.getFirstname());
        assertEquals("last names should be the same", expected.getLastname(), actual.getLastname());
        assertEquals("administrator created dates should be equal", expected.getDateCreated(), actual.getDateCreated());
        assertEquals("administrator updated dates should be equal", expected.getDateUpdated(), actual.getDateUpdated());
        assertNotNull("administrator role should not be null", actual.getRole());
        RolesValidator.validate(expected.getRole(), actual.getRole());
    }

}
